import Vue from 'vue'
import VueRouter from 'vue-router'

const home = () => import('../pages/home/home.vue')
// 默认页面
const defaultPage = () => import('../pages/default/default.vue')
// Autitile管理
const autotileManage = () => import('../pages/autotileManage/autotileManage.vue')
// 图集管理
const tilesetManage = () => import('../pages/tilesetManage/tilesetManage.vue')
// 环境管理
const envManage = () => import('../pages/envManage/envManage.vue')
// 地图编辑
const mapManage = () => import('../pages/mapManage/mapManage.vue')
// 导出
const output = () => import('../pages/output/output.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: home,
    redirect: '/',
    children: [
      {
        path: '',
        name: 'default',
        component: defaultPage,
      },
      {
        path: 'autotileManage',
        name: 'autotileManage',
        component: autotileManage,
      },
      {
        path: 'tilesetManage',
        name: 'tilesetManage',
        component: tilesetManage,
      },
      {
        path: 'envManage',
        name: 'envManage',
        component: envManage,
      },
      {
        path: 'mapManage',
        name: 'mapManage',
        component: mapManage,
      },
      {
        path: 'output',
        name: 'output',
        component: output,
      },
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
